﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace DynamicToSql
{
    public interface IParameter
    {
        string Name { get; }

        object Value { get; }

        DbType? Type { get; }

        ParameterDirection? Direction { get; }
    }

    internal sealed class Parameter : IParameter
    {
        private Parameter()
        {

        }

        internal Parameter(string name, object value)
        {
            this.Name = name;
            this.Value = value;
            this.Type = null;
            this.Direction = null;
        }

        internal Parameter(string name, object value, DbType type, ParameterDirection direction)
        {
            this.Name = name;
            this.Value = value;
            this.Type = type;
            this.Direction = direction;
        }

        public string Name { get; private set; }
        
        public object Value { get; private set; }
        
        public DbType? Type { get; private set; }
        
        public ParameterDirection? Direction { get; private set; }
    }
}
